<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Client's cards</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" type="image/ico" href="${pageContext.request.contextPath}/img/network.gif" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/styles/styles.css" type="text/css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
<script type="text/javascript" defer="defer" src="${pageContext.request.contextPath}/js/clientListCards.js"></script>
<script type="text/javascript" defer="defer" src="${pageContext.request.contextPath}/js/clientQuestionToAdmin.js"></script>
</head>
<body>
	<div id="wrapper">
		<div id="header">
			<%@ include file="/WEB-INF/jspf/header.jspf"%>
		</div><!-- #header-->
		<div id="content" class="list_cards" >
			<div align="center" style="margin: 30px 0 0 0;">
				<c:choose>
					<c:when test="${fn:length(cardbeanlist) == 0}">
						<h2><ct:i18n propertyKey="page.client.list.cards.No_such_cards"/></h2>
					</c:when>
					<c:otherwise>
						<table rules="all">
							<thead>
								<tr>
									<td>ID</td>
									<td><ct:i18n propertyKey="page.client.list.cards.Code"/></td>
									<td><ct:i18n propertyKey="page.client.list.cards.Name"/></td>
									<td><ct:i18n propertyKey="page.client.list.cards.Balance"/></td>
									<td><ct:i18n propertyKey="page.client.list.cards.Currency"/></td>
									<td><ct:i18n propertyKey="page.client.list.cards.Status"/></td>
								</tr>
							</thead>
							<c:forEach var="bean" items="${cardbeanlist}">
								<tr >
									<td><c:out value="${bean.id}" /></td>
									<td><span class="card_id" id="${bean.id}"><c:out value="${bean.code}" /></span></td>
									<td><c:out value="${bean.name}" /></td>
									<td><span class="balance" id="${bean.id}"><c:out value="${bean.balance}" /></span></td>
									<td><c:out value="${bean.currency}" /></td>
									<td><ct:i18n propertyKey="page.client.list.cards.${bean.status}"/></td>
								</tr>
							</c:forEach>
						</table>
					</c:otherwise>
				</c:choose>
				<div id="invisible_block">
					<p id="active_card"></p>
					<form action="controller" method="post">
						<input type="hidden" id="hidden_id" name="id" value=""> 
						<input type="radio" id="withdraw" name="command" value="withdraw" checked><ct:i18n propertyKey="page.client.list.cards.withdraw"/> 
						<input type="radio" id="replenish"	name="command" value="replenish"><ct:i18n propertyKey="page.client.list.cards.replenish"/><br> 
						<input type="text" name="sum" id="enter_sum" placeholder="<ct:i18n propertyKey="page.client.list.cards.enter_sum"/>" required>
						<input type="submit" id="send_action" value="<ct:i18n propertyKey="page.client.list.cards.enter"/>" class="submit">
					</form>
					<form action="controller" method="post">
						<input id="hidden_id_lock" type="hidden" name="id" value="">
						<input type="hidden" name="command" value="lockCard"> 
						<input type="submit" value='<ct:i18n propertyKey="page.client.list.cards.lock"/>' class="submit"><br>
					</form>
				</div>
			</div>
		</div><!-- #content-->
	</div><!-- #wrapper -->
	<div id="footer">
		<%@ include file="/WEB-INF/jspf/footer.jspf"%>
	</div><!-- #footer -->
</body>
</html>